package com.itany.corejava.code08_常用类.练习7;

/**
 * @author MissChen
 * @version 1.0
 * @date 2023 年11月17日 9:18
 */
public class HomeTown implements ReturnString<HomeTown>{
    private String name;
    private String loc;

    public HomeTown(String name, String loc) {
        this.name = name;
        this.loc = loc;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLoc() {
        return loc;
    }

    public void setLoc(String loc) {
        this.loc = loc;
    }

    @Override
    public String returnString(HomeTown homeTown) {
        String name= homeTown.getName();
        if(name.indexOf("京")!=-1){
            return name;
        }
        return "";
    }
}
